package com.shujia.spark.opt

import com.esotericsoftware.kryo.Kryo
import com.shujia.spark.opt.Demo6Kryo.Student
import org.apache.spark.serializer.KryoRegistrator

class Demo7KryoRegister extends KryoRegistrator {
  override def registerClasses(kryo: Kryo): Unit = {
    //对需要使用kryo做序列化的类机械能注册
    kryo.register(classOf[Student])
    kryo.register(classOf[String])
    kryo.register(classOf[Int])
  }
}
